package com.quad.innovators.salesease.converter;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.quad.innovators.salesease.common.result.PageResultBean;
import com.quad.innovators.salesease.model.vo.stock.ProductInfoIdentityGroupVO;
import com.quad.innovators.salesease.model.vo.stock.ProductInfoIdentityVO;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @author : shanshan.li
 * @createTime : 2024/10/20 09:51
 * @Version : 1.0
 */
@Mapper(componentModel = "spring")
public interface ProductInfoIdentityConverter {

    @Mappings({
            @Mapping(target = "items", source = "records"),
            @Mapping(target = "pageInfo.currPage", source = "current"),
            @Mapping(target = "pageInfo.totalCount", source = "total"),
            @Mapping(target = "pageInfo.pageSize", source = "size")
    })
    PageResultBean<ProductInfoIdentityVO> toPageVo(Page<ProductInfoIdentityVO> bo);

    @Mappings({
            @Mapping(target = "items", source = "records"),
            @Mapping(target = "pageInfo.currPage", source = "current"),
            @Mapping(target = "pageInfo.totalCount", source = "total"),
            @Mapping(target = "pageInfo.pageSize", source = "size")
    })
    PageResultBean<ProductInfoIdentityGroupVO> toPageGroupVo(Page<ProductInfoIdentityGroupVO> productInfoIdentityPage);
}
